package system

import (
	"context"
	"gf-assistant/internal/common/factory"
	"gf-assistant/internal/system/parameter"
)

// Org 组织机构
var Org = OrgController{service: "system.OrgService"}

type OrgController struct{ service string }

func (c *OrgController) GetOrgCombox(ctx context.Context, req *parameter.GetOrgComboxReq) (res *parameter.GetOrgComboxRes, err error) {
	return GetOrgService().GetOrgCombox(ctx, req), nil
}
func (c *OrgController) GetOrgTree(ctx context.Context, req *parameter.GetOrgTreeReq) (res *parameter.GetOrgTreeRes, err error) {
	return GetOrgService().GetOrgTree(ctx, req), nil
}
func (c *OrgController) ListOrg(ctx context.Context, req *parameter.ListOrgReq) (res *parameter.ListOrgRes, err error) {
	return GetOrgService().ListOrg(ctx, req), nil
}
func (c *OrgController) SaceOrg(ctx context.Context, req *parameter.SaveOrgReq) (res *parameter.SaveOrgRes, err error) {
	return GetOrgService().SaveOrg(ctx, req), nil
}
func GetOrgService() *OrgService {
	return factory.Get(Org.service).(*OrgService)
}
